#!/bin/bash
source /opt/mrsClient/bigdata_env
ds=$(date -d "1 days ago" +%Y%m%d)
echo "ds=${ds}"
start=$(date '+%s')
beeline --entirelineascommand=false -e "use dwd_amr_uep;insert overwrite directory '/user/cq_qkjdyjc/cur_${ds}' row format delimited fields terminated by '\t' select i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16,i17,i18,i19,i20,i21,i22,i23,i24,i25,i26,i27,i28,i29,i30,i31,i32,i33,i34,i35,i36,i37,i38,i39,i40,i41,i42,i43,i44,i45,i46,i47,i48,i49,i50,i51,i52,i53,i54,i55,i56,i57,i58,i59,i60,i61,i62,i63,i64,i65,i66,i67,i68,i69,i70,i71,i72,i73,i74,i75,i76,i77,i78,i79,i80,i81,i82,i83,i84,i85,i86,i87,i88,i89,i90,i91,i92,i93,i94,i95,i96,extend_field_8,ds,org_no,phase_flag from std_uep_un15_02_amr_e_mp_cur_curve where ds = '${ds}'"
echo "日期:${ds} 已执行完hive电流数据入hdfs"
beeline --entirelineascommand=false -e "use dwd_amr_uep;insert overwrite directory '/user/cq_qkjdyjc/vol_${ds}' row format delimited fields terminated by '\t' select u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15,u16,u17,u18,u19,u20,u21,u22,u23,u24,u25,u26,u27,u28,u29,u30,u31,u32,u33,u34,u35,u36,u37,u38,u39,u40,u41,u42,u43,u44,u45,u46,u47,u48,u49,u50,u51,u52,u53,u54,u55,u56,u57,u58,u59,u60,u61,u62,u63,u64,u65,u66,u67,u68,u69,u70,u71,u72,u73,u74,u75,u76,u77,u78,u79,u80,u81,u82,u83,u84,u85,u86,u87,u88,u89,u90,u91,u92,u93,u94,u95,u96,extend_field_8,ds,org_no,phase_flag from std_uep_un15_02_amr_e_mp_vol_curve where ds = '${ds}'"
echo "日期:${ds} 已执行完hive电压数据入hdfs"
beeline --entirelineascommand=false -e "use dwd_amr_uep;insert overwrite directory '/user/cq_qkjdyjc/power_${ds}' row format delimited fields terminated by '\t' select p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30,p31,p32,p33,p34,p35,p36,p37,p38,p39,p40,p41,p42,p43,p44,p45,p46,p47,p48,p49,p50,p51,p52,p53,p54,p55,p56,p57,p58,p59,p60,p61,p62,p63,p64,p65,p66,p67,p68,p69,p70,p71,p72,p73,p74,p75,p76,p77,p78,p79,p80,p81,p82,p83,p84,p85,p86,p87,p88,p89,p90,p91,p92,p93,p94,p95,p96,extend_field_8,ds,org_no,data_type from std_uep_un15_02_amr_e_mp_power_curve where ds = '${ds}'"
echo "日期:${ds} 已执行完hive功率数据入hdfs"
end=$(date '+%s')
took=$((start-end))
echo "总耗时:${took}s"
